/*
 * $Id: ActOnwatchTask.java,v 1.11 2009/12/16 18:31:22 navdeep_mahajan Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

/*
 * Created Mon Apr 27 12:06:48 CDT 2009 by MyEclipse Hibernate Tool.
 */
package com.ge.healthcare.autosc.common.database.pojo;

import java.io.Serializable;

import com.ge.healthcare.autosc.common.util.TimeFormatStandard;

/**
 * A class that represents a row in the 'ACT_ONWATCH_TASK' table. This class may
 * be customized as it is never re-generated after being created.
 */
public class ActOnwatchTask extends AbstractOnwatchTask implements Serializable {
	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = 7573356379475443650L;
	public static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.ActOnwatchTask";
	public static final String COL_ONWATCH_TASK_ID = "onwatchTaskId";
	public static final String COL_ENTERED_DATE = "enteredDate";
	public static final String COL_EXECUTION_TIME_IN_SEC = "executionTimeInSec";
	public static final String COL_DELIVERED_DATE = "deliveredDate";
	public static final String COL_COMPLETION_DATE = "completionDate";
	public static final String COL_ONWATCH_TASK_LIST_ID = "onwatchTaskListId";
	public static final String COL_TASK_ID = "taskId";
	public static final String COL_STATUS = "status";
	public static final String COL_TASK_ORDER = "taskOrder";
	public static final String SUCCESS_STATUS = "SUCCESS";
	public static final String FAILURE_STATUS = "FAILURE";
	public static final String NEW_STATUS = "NEW";
	public static final String DELIVERED_STATUS = "DELIVERED";
	public static final String INVALID_STATUS = "INVALID";
	private CfgRequestDefn requestDefn = null;

	/**
	 * Simple constructor of ActOnwatchTask instances.
	 */
	public ActOnwatchTask() {
	}

	/* Add customized code below */

	public void markSuccess() {
		this.setStatus(SUCCESS_STATUS);
	}

	public boolean isSuccess() {
		return (SUCCESS_STATUS.equalsIgnoreCase(this.getStatus()));
	}

	public void markFailure() {
		this.setStatus(FAILURE_STATUS);
	}

	public boolean isFailure() {
		return (FAILURE_STATUS.equalsIgnoreCase(this.getStatus()));
	}

	public void markDelivered() {
		this.setStatus(DELIVERED_STATUS);
	}

	public boolean isDelivered() {
		return (DELIVERED_STATUS.equalsIgnoreCase(this.getStatus()));
	}

	public void markNew() {
		this.setStatus(NEW_STATUS);
	}

	public boolean isNew() {
		return (NEW_STATUS.equalsIgnoreCase(this.getStatus()));
	}

	public void markInvalid() {
		this.setStatus(INVALID_STATUS);
	}

	public boolean isInvalid() {
		return (INVALID_STATUS.equalsIgnoreCase(this.getStatus()));
	}

	public String toString() {
		StringBuffer str = new StringBuffer();
		str = str.append("{onwatchTaskId=").append(this.getOnwatchTaskId())
				.append("},");
		str = str.append("{enteredDate=").append(
				TimeFormatStandard.getDtInEndUserDisplayFormat(this
						.getEnteredDate())).append("},");
		str = str.append("{deliveredDate=").append(
				TimeFormatStandard.getDtInEndUserDisplayFormat(this
						.getDeliveredDate())).append("},");
		str = str.append("{completionDate=").append(
				TimeFormatStandard.getDtInEndUserDisplayFormat(this
						.getCompletionDate())).append("},");
		str = str.append("{executionTimeInSec=").append(
				this.getExecutionTimeInSec()).append("},");
		str = str.append("{taskId=").append(this.getTaskId()).append("},");
		str = str.append("{onwatchTaskListId=").append(
				this.getOnwatchTaskListId()).append("},");
		str = str.append("{taskOrder=").append(this.getTaskOrder())
				.append("},");
		str = str.append("{status=").append(this.getStatus()).append("}");
		return str.toString();
	}

	public CfgRequestDefn getRequestDefn() {
		return requestDefn;
	}

	public void setRequestDefn(CfgRequestDefn requestDefn) {
		this.requestDefn = requestDefn;
	}

	public void resetOnwatchTaskListId() {
		this.setOnwatchTaskListId(new Long(0));
	}
}
